package airportCoordinationMonitor;

import java.util.Calendar;

public class PacketLog implements Comparable<PacketLog>{
	private int id;
	private int port;
	private Calendar timestamp;
	
	public PacketLog(int i, int p)
	{
		id = i;
		port = p;
		timestamp = Calendar.getInstance();
	}
	
	public boolean timedout(int s_timeout)
	{
		Calendar now = Calendar.getInstance();
		now.add(Calendar.SECOND, -s_timeout);
		return !timestamp.after(now);
	}
	
	public int compareTo(PacketLog pack) {
		return id - pack.id;
	}
	
	public int get_port()
	{
		return port;
	}
}
